import { useLanguage } from '../contexts/LanguageContext';

export const useLocalizedLink = () => {
  const { language } = useLanguage();

  const getLink = (path: string) => {
    // Ensure path starts with /
    const normalizedPath = path.startsWith('/') ? path : `/${path}`;
    return language === 'zh-CN' ? `/zh-CN${normalizedPath}` : normalizedPath;
  };

  return { getLink };
};
